<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.3.1.js"></script>
</head>
<body>
<form>
    <input name="phone" id="phone" placeholder="手机号" /><br /><br />

    <input name="validate" id="yzm" placeholder="验证码" />
    <input type="button" value="发送验证码" />
    <br /><br />
    <input name="newPwd" id="userPwd" placeholder="密码" type="password" /><br /><br />
    <input type="button" value="重置密码" />
</form>

<script>
    $(f);

    function f(){
        $("input[value=发送验证码]").click(sendMsg);
        $("input[value=重置密码]").click(resetPwd);
    }
    //updateuserpwd

    function resetPwd(){
        $.post("http://web7.hfbdqn.cn/shop/updateuserpwd"
        ,$("form").serialize(),function(data){
            console.log(data);
            })
    }

    function sendMsg(){
        // jquery jsonp 跨域
        $.ajax({
            url:"http://web7.hfbdqn.cn/shop/yzm",
            dataType:"jsonp",
            success:function(data){
                console.log(data.code);
            }
        });
    }
</script>

</body>
</html>